//
//  MydepositViewController.m
//  Manage
//
//  Created by 杨康 on 2018/1/10.
//  Copyright © 2018年 杨康. All rights reserved.
//

#import "MydepositViewController.h"

@interface MydepositViewController ()

@end

@implementation MydepositViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title=@"我的押金";
    
    
    UIImageView *bgImg=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"押金背景"]];
    [self.view addSubview:bgImg];
    [bgImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.view);
        make.top.mas_equalTo(TOP_HEIGHT);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, SCREEN_WIDTH*58/75));
    }];
    
    
    
    UILabel *numLab=[SingLeton myLabel:[UIColor colorWithHexString:@"09be00"] andTitle:@"1000" andFont:40];
    [bgImg addSubview:numLab];
    [numLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(100);
        make.centerX.mas_equalTo(bgImg);
    }];
    
    
    UILabel *titleLab=[SingLeton myLabel:[UIColor colorWithHexString:@"222222"] andTitle:@"我的押金(元)" andFont:14];
    [bgImg addSubview:titleLab];
    [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(bgImg);
        make.top.mas_equalTo(numLab.mas_bottom).mas_offset(10);
    }];
    
    
    YKButton *quitButton=[SingLeton endButton:[UIColor whiteColor] andTitle:@"退押金" RequestSuccess:^(UIButton *btn) {
//        UIAlertController *alertController=[UIAlertController alertControllerWithTitle:@"申请退押金" message:@"您将不能享受快电的服务，确定要离开吗？" preferredStyle:UIAlertControllerStyleAlert];
//        UIAlertAction *noAction=[UIAlertAction actionWithTitle:@"再见了" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//
//        }];
//
//        UIAlertAction *someAction=[UIAlertAction actionWithTitle:@"留下来" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//
//        }];
//
//
//        [alertController addAction:noAction];
//        [alertController addAction:someAction];
//        [self presentViewController:alertController animated:YES completion:nil];
//        [noAction setValue:[UIColor color9] forKey:@"titleTextColor"];
//        [someAction setValue:[UIColor colorWithHexString:@"09be00"] forKey:@"titleTextColor"];
        
        
        UIAlertController *alertController=[UIAlertController alertControllerWithTitle:@"申请退押金" message:@"电池正在使用中，请先到附近站点归还后，再进行退押金操作，感谢您的使用。" preferredStyle:UIAlertControllerStyleAlert];
        
        UIAlertAction *someAction=[UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
            
        }];
        
        
        
        [alertController addAction:someAction];
        [self presentViewController:alertController animated:YES completion:nil];
        
        [someAction setValue:[UIColor colorWithHexString:@"09be00"] forKey:@"titleTextColor"];
        
        
        
    }];
    [self.view addSubview:quitButton];
    [quitButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.bottom.mas_equalTo(-20);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH-40, 44));
    }];
    quitButton.layer.borderWidth=1;
    quitButton.layer.borderColor=[UIColor colorWithHexString:@"09be00"].CGColor;
    quitButton.titleLabel.font=[UIFont systemFontOfSize:16];
    [quitButton setTitleColor:[UIColor colorWithHexString:@"09be00"] forState:UIControlStateNormal];
    
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
